#ifndef _UI_H // 防止重复包含
#define _UI_H

#define DEFAULT_BUTTON_COLOR 0Xff0000 
#define PRESSED_BUTTON_COLOR 0X00ff00 
#define TEXT_BUTTON_COLOR 0X000000 


#include "disp_manager.h"
#include "common.h"
#include "input_manager.h"

struct Button;

typedef int (*ONDRAW_FUNC)(struct Button *ptbutton , PDispBuffer ptDispBuffer);// 按钮的绘制
typedef int (*ONPRESS_FUNC)(struct Button *ptbutton , PDispBuffer ptDispBuffer , PInputEvent ptInputEvent); // 按钮的处理


typedef struct Button{
    char *name;
    int status;
    Region tRegion;
    ONDRAW_FUNC OnDraw;// 按钮的绘制
    ONPRESS_FUNC OnPress; // 按钮的处理

}Button,*PButton;

int ButtonInit (PButton ptButton , char *name , PRegion ptRegion , ONDRAW_FUNC OnDraw , ONPRESS_FUNC OnPress);



#endif